#ifndef MAIN_CIRCLE_Hpp
#define MAIN_CIRCLE_Hpp
#include <chrono>
#include <memory>
#include <iostream>
#include <vector>
#include "Serial.hpp"
#include "uart.hpp"
#include "info_process.hpp"
class Motor_Circle : public Serial
{
    public:
     Motor_Circle(std::string port, int baud);
     ~Motor_Circle(){}
    int rec_ok(std::vector<u_int8_t> &msg);
    void set_send_v(int n,int id);
    virtual void recvMsg(std::vector<u_int8_t> &msg) override;
    virtual void startTimer(int ms_s)override;
    void topic_callback(std::vector<int32_t> &msg);
    void timer_callback(void);
     int circle_count=0;
    // //int circle_step=0;
    // int send_count[4];
    // int rec_count[4];
     int Fucn_flag=0;
    int bianma_id_rec_count[4];
    int motor_lun_id_rec_count[4];
    int zhaun_id_rec_count[4];
    int send_sum_count;
    const int bianma_id[4]={0x0111,0x0112,0x0113,0x0114}; 
    const int bianma_negative[4]={1,1,1,1};
    const int motor_lun_id[4]={0x0151,0x0152,0x0153,0x0154}; 
    const int motor_lun_negative[4]={1,1,-1,-1};
    const int zhuan_id[4]={0x0161,0x0162,0x0163,0x0164}; 
    const int zhuan_negative[4]={-1,1,-1,-1};
    int speed_set[4];
    int speed_cur[4];
    int zhuan_cur[4];
    int zhuan_set[4];
    int angle_cur[4];
    int angle_set[4];
    int32_t step_count[4];
    u_char send_buf[12][12];
    Motor_Info_Press *mip;
    void swap_ctr(void);
    void swap_info(void);
    void set_motor_line(float x,float y,float z);
    float linex,liney,wmga;
    ///
    Uart *uart_zhuan;
};


#endif